package at.dahu4wa.fxclient.framework;

import at.dahu4wa.fxclient.Main;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Node;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuItem;

public class TopMenuBarController {

	private final TopMenuBarView view;
	Menu fileMenu;
	MenuItem openMenu;

	public TopMenuBarController(TopMenuBarView view) {
		this.view = view;
		initMenuBar();
	}

	private void initMenuBar() {

		fileMenu = new Menu("File");
		Menu settingsMenu = new Menu("Settings");
		Menu aboutMenu = new Menu("About");
		openMenu = new MenuItem("Open");
		view.getMenus().addAll(fileMenu, settingsMenu, aboutMenu);
		fileMenu.getItems().add(openMenu);
		
		openMenu.setOnAction(new EventHandler<ActionEvent>() {

			@Override
			public void handle(ActionEvent event) {
				
					System.out.println("Open File");
			}
		});
			
			
		}
	public Menu getTopMenu(){
			return fileMenu;
	}
	
	public MenuItem getOpenMenu(){
		return openMenu;
}
	

	

}
